//
//  AreaScope.m
//  Hive
//
//  Created by 惠俊贝 on 15/8/21.
//  Copyright (c) 2015年 ZM. All rights reserved.
//

#import "AreaScopeInfo.h"

@implementation AreaScopeInfo

+ (AreaScopeInfo *)createAreaScopeInfoWithDic:(NSDictionary *)dic {
    AreaScopeInfo *info = [[AreaScopeInfo alloc] init];
    
    info.ID = [dic objectForKey:@"ID"];                         //1 围栏ID
    info.AreaName = [dic objectForKey:@"AreaName"];             //2 围栏名称
    info.UserID = [dic objectForKey:@"UserID"];                 //3 用户ID
    info.AreaType = [dic objectForKey:@"AreaType"];             //4 围栏类型
    info.ParameterSets = [dic objectForKey:@"ParameterSets"];   //5 围栏参数
    info.State = [[dic objectForKey:@"State"] boolValue];       //6 是否有效
    info.Remark = [dic objectForKey:@"Remark"];                 //7 备注
    info.CreatorID = [dic objectForKey:@"CreatorID"];           //8 创建人ID
    info.CreateTime = [dic objectForKey:@"CreateTime"];         //9 创建时间
    info.UpdatorID = [dic objectForKey:@"UpdatorID"];           //10 修改人ID
    info.UpdateTime = [dic objectForKey:@"UpdateTime"];         //11 修改时间
    info.InOrOut = [[dic objectForKey:@"InOrOut"] boolValue];   //12 出入警告类型
    
    return info;
}

+ (NSArray *)createAreaScopeInfosWithDicArray:(NSArray *)arr {
    NSMutableArray *rs = [[NSMutableArray alloc] init];
    for ( NSDictionary *dic in arr) {
        [rs addObject:[AreaScopeInfo createAreaScopeInfoWithDic:dic]];
    }
    return rs;
}
@end
